package com.zm.openapi.exception;

import com.zm.openapi.enums.CommonEnum;

public class ValidationException extends RuntimeException {
    private String code;
    private String msg;

    public ValidationException() {
        super(CommonEnum.INVALID_IDENTIFY.getMsg());
        this.code = CommonEnum.INVALID_IDENTIFY.getCode();
        this.msg = CommonEnum.INVALID_IDENTIFY.getMsg();
    }

    public ValidationException(CommonEnum error) {
        super(error.getMsg());
        this.code = error.getCode();
        this.msg = error.getMsg();
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
